package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	comm "gitee.com/cloudapex/protos/comm/pb"
	gpb "gitee.com/cloudapex/protos/crm_base/pb"
	"google.golang.org/grpc"
)

var PoolNodeSer poolnodeser

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_CRM_BASE, func(c *grpc.ClientConn) {
		PoolNodeSer.cli = gpb.NewPoolNodeSerClient(c)
	})
}

type poolnodeser struct {
	cli gpb.PoolNodeSerClient
}

/**
 *说明：添加记录
 *参数：1.PoolNode
 */

func (this *poolnodeser) PoolNodeAdd(ctx context.Context, in *gpb.PoolNode) (*comm.BaseRes, error) {
	return this.cli.PoolNodeAdd(ctx, in)
}

/**
 *说明：查询单条记录
 *参数：1.PoolNode
 */

func (this *poolnodeser) SelectPoolNode(ctx context.Context, in *gpb.PoolNode) (*gpb.BaseNodeRes, error) {
	return this.cli.SelectPoolNode(ctx, in)
}

//说明：获取备注记录列表
//参数：1.PoolNode
func (this *poolnodeser) GetPoolNodeList(ctx context.Context, in *gpb.PoolNodeReq) (*gpb.PoolNodeRes, error) {
	return this.cli.GetPoolNodeList(ctx, in)
}
